let list = [
    'lyky',
    // 'bosheng'
]
// let baseUrl
// if( process.env.NODE_ENV === 'development'){
//     baseUrl = process.env.VUE_APP_BASE_API.split('://')[1].slice(0, process.env.VUE_APP_BASE_API.split('://')[1].indexOf('.taijieyun'))
// }else{
//     baseUrl = window.location.href.split('://')[1].slice(0, window.location.href.split('://')[1].indexOf('.taijieyun'))
// }
const baseUrl = process.env.NODE_ENV === 'development' ? process.env.VUE_APP_BASE_API : window.location.href.slice(0, window.location.href.indexOf('/site'))

export function platformShow(path){
    // list.forEach(item=>{
    //     if(baseUrl.indexOf(item)!=-1){
    //         return true
    //     }else{
    //         return false
    //     }
    // })
    if(baseUrl.indexOf(path)!=-1){
        return true
    }else{
        return false
    }
}

//同地矿安全设定
export function platformAnhui(gz=''){
    /*
        gz 企业限制工种不同有不同的判断
        fileList 企业附件  有则填入无则不传或值为 null
    */
    let platList = [
        {
            gz:[],
            platName:'dkaq',
            fileList:[ 
                {
                    name:'报名表下载',
                    gz:['特种作业'],
                    filePath:'https://dkaq.taijieyun.com/storage/userimage/dkaq/20221114/983a84f2eeccb07ac44bfdea89ee2571.doc',
                },
                {
                    name:'报名表下载',
                    gz:['一般工贸','安全管理','高危安管'],
                    filePath:'https://dkaq.taijieyun.com/storage/userimage/dkaq/20221114/6182ba9e60c9500b76c52c3f42fca0d9.doc',
                },
                {
                    name:'任命文书下载',
                    gz:['一般工贸','安全管理','高危安管'],
                    filePath:'https://dkaq.taijieyun.com/storage/userimage/dkaq/20221114/fdf8c2f000a3becdbf5ca52495aa44dd.docx',
                },
            ],
        },
        {
            gz:[],
            platName:'shengya',
            fileList:[
                {
                    name:'报名表下载',
                    gz:['特种作业'],
                    filePath:'https://shengya.taijieyun.com/storage/userimage/shengya/20221202/3adf2a065a4c63bd3ab58164d5ee42a9.doc',
                },
                {
                    name:'报名表下载',
                    gz:['一般工贸','安全管理','高危安管'],
                    filePath:'https://shengya.taijieyun.com/storage/userimage/shengya/20221202/1e1db4dd603264810a34901d1deb3c4a.doc',
                },
                {
                    name:'任命文书下载',
                    gz:['一般工贸','安全管理','高危安管'],
                    filePath:'https://shengya.taijieyun.com/storage/userimage/shengya/20221202/4437047d823dfbb5c477461d8d00866d.docx',
                },
            ],
        },
    ]
    for (let index = 0; index < platList.length; index++) {
        const item = platList[index];
        // item.platName
        if(baseUrl.includes(item.platName)){
            if(gz&&item.gz.includes(gz)){
                return item.fileList || true
            }else
            if(!gz){
                return item.fileList || true
            }else {
                return false
            }
        }
    }
    return false
}